<template>
  <div>
    <div class="bd">
      <div class="wai">
        <div class="item" v-for="item in items" :key="item.id" id="bangdanitem">
          <div class="yanse" :style="{ backgroundColor: item.color }">
            <h1>一周榜单|TOP3</h1>
            <p>{{ item.date }}</p>
          </div>

          <div class="name">
            <div style="font-size: 16px">
              <span style="color: red">1</span>&nbsp;&nbsp;<span
                style="color: #8a8a8a"
                >{{ item.bookname[0] }}</span
              >
            </div>
            <div style="font-size: 16px">
              <span style="color: red">2</span>&nbsp;&nbsp;<span
                style="color: #8a8a8a"
                >{{ item.bookname[1] }}</span
              >
            </div>
            <div style="font-size: 16px">
              <span style="color: red">3</span>&nbsp;&nbsp;<span
                style="color: #8a8a8a"
                >{{ item.bookname[2] }}</span
              >
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    items: {
      type: Array,
      required: true,
    },
  },
};
</script>

<style lang="scss">
.bd {
  height: 205px;
  // display: flex; /* 使用 Flex 布局 */
  // overflow-x:scroll; /* 设置横向滚动 */
  width: 100%;
}
#bangdanitem {
  float: left;
  margin-left: 2px;
  
  height: 200px;
  width: 180px;
}
.wai {
  width: 100%;
  height: 175px;
  background-color: white;
  margin-right: 1px;
  padding-bottom: 10px;
  flex-shrink: 0; /* 防止盒子缩小 */
  /* 设置盒子宽度 */
  //   overflow: auto; /* 设置盒子内部内容可滚动 */
  border-radius: 4px 4px;
}
.yanse {
  padding-top: 5px;
  height: 110px;
  // background-color: plum;
  color: #ffffff;
  h1,
  p {
    margin-left: 15px;
  }
}
.name {
  margin-top: 6px;
  margin-left: 20px;
  div {
    font-size: 18px;
  }
}
.yanse>p{
    padding-top: 8px;

}
</style>
